PhoneNumberInput flag size#3743
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 07ae186 The changes in this PR will be included in the next version bump. This PR includes changesets to release 7 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## next #3743 +/- ##
==========================================
- Coverage 93.40% 93.35% -0.05%
==========================================
Files 197 197
Lines 4334 4336 +2
Branches 1745 1749 +4
==========================================
Hits 4048 4048
- Misses 259 261 +2
Partials 27 27
🚀 New features to boost your workflow:
|
| countryCode.ref as ForwardedRef<HTMLSelectElement>, | ||
| )} | ||
| renderPrefix={countryCode.renderPrefix ?? DefaultPrefix} | ||
| renderPrefix={countryCode.renderPrefix ?? getDefaultPrefix(size)} |
There was a problem hiding this comment.
Should getDefaultPrefix(size) be memoized so it doesn't end up creating a new reference on every render?
There was a problem hiding this comment.
both getDefaultPrefix and DefaultPrefix are defined outside of the PhoneNumberInput component. They will not be recreated on re-render.
Addresses DSYS-1762
Purpose
#3711 introduced the
sizeprop in the Flag component. Since we also recently support sizes in input fields, we can make the flag size in the PhoneNumberInput component responsive to the input's size.Approach and changes
Use PhoneNumberInput's size to adjust default prefix flag size accordingly.
Definition of done